/**
 * Choicesoft.com.cn Inc.
 * Copyright (c) 2004-2018 All Rights Reserved.
 */
package com.test.springboot.mybatis;

import com.test.springboot.mybatis.entity.PayRecord;
import com.test.springboot.mybatis.entity.PayRecordDetail;
import com.test.springboot.mybatis.service.PayRecordDetailService;
import com.test.springboot.mybatis.service.PayRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenxubing
 * @version $Id: SpringBootMybatisApplication.java, v 0.1 2018-09-08 下午7:22 chenxubing Exp $$
 */
@SpringBootApplication
@EnableAutoConfiguration
@ServletComponentScan
@RestController
public class SpringBootMybatisApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootMybatisApplication.class, args);
    }

    @Autowired
    private PayRecordService payRecordService;
    @Autowired
    private PayRecordDetailService payRecordDetailService;

    @GetMapping("/payRecord/{id}")
    public PayRecord payRecord(@PathVariable int id){
        return payRecordService.getById(id);
    }

    @GetMapping("/payRecordDetail/{id}")
    public PayRecordDetail payRecordDetail(@PathVariable int id){
        return payRecordDetailService.getById(id);
    }
}
